export interface userItemInterface{
    userId: string,
    username: string,
    gender: string,
    user:{detail: { age: string }},
    idCard: string,
    email: string,
    address: string,
    status: string,
    createTime: string,
}
export interface dataInterface{
    list:userItemInterface[],
    pageNum:number,
    pageSize:number,
    total:number
}
export let data = {
    list: [
        {
            userId: "1",
            username: "小明",
            gender: "1",
            user:{detail: { age: "21" }},
            idCard: "410323",
            email: "17718558692@163.com",
            address: "北京",
            status: "1",
            createTime: "2023-10-10",
        },
        {
            userId: "2",
            username: "小花",
            gender: "2",
            user:{detail: { age: "19" }},
            idCard: "410323",
            email: "13318558692@163.com",
            address: "上海",
            status: "1",
            createTime: "2023-10-10",
        },
        {
            userId: "3",
            username: "小白",
            gender: "1",
            user:{detail: { age: "23"}},
            idCard: "410323",
            email: "13618558692@163.com",
            address: "北京",
            status: "1",
            createTime: "2023-10-11",
        },
    ],
    pageNum: 1,
    pageSize: 10,
    total: 0
}

export const addUser = (body: userItemInterface) => {
    data.list.push(body)
}
export const delUser = (userId: string) => {
    data.list.filter(item => item.userId !== userId)
}
export const getUser = () => {
    data.total=data.list.length
    return data
}



